/**
 * Node for representing Dijkstra
 * 
 * @author anthonysierra
 * 
 */
public class DijkstrasNode implements Comparable {
	private Vertex my_current_vertex;
	private Vertex my_previous_vertex;
	private int label;
	private boolean known;
	private int heap_location;

	/**
	 * Allocates Dijkstra's node for easy vertex information
	 */
	public DijkstrasNode() {
		super();
	}

	public Vertex getCurrentVertex() {
		return my_current_vertex;
	}

	public Vertex getPreviousVertex() {
		return my_previous_vertex;
	}

	public int getLabel() {
		return label;
	}

	public boolean isKnown() {
		return known;
	}

	public int getHeapLocation() {
		return heap_location;
	}

	public void setCurrentVertex(Vertex the_vertex) {
		my_current_vertex = the_vertex;
	}

	public void setPreviousVertex(Vertex the_vertex) {
		my_previous_vertex = the_vertex;
	}

	public void setLabel(int the_int) {
		label = the_int;
	}

	public void setKnown(boolean the_known) {
		known = the_known;
	}

	public void setHeapLocation(int the_heap_location) {
		heap_location = the_heap_location;
	}

	/**
	 * Compares against another DijkstraNode
	 * 
	 * @param arg0
	 * @return
	 */
	@Override
	public int compareTo(Object arg0) {
		if (arg0 instanceof DijkstrasNode) {
			return label - ((DijkstrasNode) arg0).getLabel();
		} else
			throw new IllegalArgumentException();
	}
}
